#include "SBFollow.h"

#include "AIAgent.h"

SBFollow::SBFollow(AIAgent* __restrict agent, GameObject* __restrict target, float dist) : Behaviour(agent), m_distance(dist)
{
	m_pTarget = target;
}

Vec3f SBFollow::Update()
{
	Vec3f targetPoint = m_pTarget->GetPos() - (m_pTarget->GetVel().TruncateReturn(m_distance));
	Vec3f steering = (targetPoint - m_pAgent->GetPos());//.TruncateReturn(m_pAgent->GetMaxForce());
	return steering;
}

